package trianglexercises;

import java.io.*;

import static trianglexercises.Utilities.readInput;

/**
 * Created by ravindra on 18/7/14.
 */
class DriveRightTriangle{
    public static void main(String[] Args){
        int size = 0;
        String input = null;
        RightTriangle rightTriangle = new RightTriangle();

        System.out.println("To exit type -> quit. \n");

        input = readInput("size");

        while(!input.equals("quit")){
            size = Integer.parseInt(input);
            rightTriangle.print(size);

            input = readInput("size");
        }


    }
}

class RightTriangle {
    void print(int size){
        if(size < 2 ){
            System.out.println("That does look like a triangle!!");
            return;
        }

        for (int i = 0; i < size; i++){
            for(int j = 0; j <= i; j++){
                System.out.print("*");
            }
            System.out.println("");
        }
    }
}
